package main

import (
	//TODO  包别名
	System "fmt"
)

//map 结构

func main() {
	// 声明map
	// 初始化map
	maps := make(map[string]int)
	//mapbase()
	for i := 0; i < 10; i++ {
		mapsKey := "name" + string(rune(i))
		maps[mapsKey] = i
	}
	for k, v := range maps {
		System.Println("s: ", k, v)
	}
	System.Println(maps)

	flag := false //bool = java boolean
	System.Println("flag", flag)
}

func mapbase() {
	// 声明map
	var maps map[string]int
	// 初始化map
	maps = make(map[string]int)
	// map 赋值
	maps["one1"] = 1
	maps["one2"] = 2
	// map
	System.Println("one1:=", maps["one1"])

	System.Println(maps)
	// 删除指定map中指定key
	delete(maps, "one1")
	System.Println(maps)
	//重新指定map的内存空间 = 删除原map的所有值,开辟一个新空间给变量map
	maps = make(map[string]int)

	System.Println(maps)
}
